﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace Tweets.Library
{
    /// <summary>
    /// Each tweet from the timeline.
    /// </summary>
    public class Tweet
    {
        /// <summary>
        /// Date/time tweet occurred.
        /// </summary>
        [JsonProperty(PropertyName = "created_at")]
        [JsonConverter(typeof(TwitterDateTimeConverter))]
        public DateTime CreatedOn { get; set; }

        /// <summary>
        /// Id of the tweet.
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        public long Id { get; set; }

        /// <summary>
        /// Was the tweet truncated?
        /// </summary>
        [JsonProperty(PropertyName = "truncated")]
        public bool Truncated { get; set; }

        /// <summary>
        /// The tweet content.
        /// </summary>
        [JsonProperty(PropertyName = "text")]
        public string Text { get; set; }

        /// <summary>
        /// Reference to the user that tweeted.
        /// </summary>
        [JsonProperty(PropertyName = "user")]
        public TwitterUser User;

        /// <summary>
        /// Reference to the Twitter Entities collection.
        /// </summary>
        [JsonProperty(PropertyName = "entities")]
        public TwitterEntities Entities = new TwitterEntities();
    }
}
